﻿using System;
using JamesZhao.Engine.Graphics.Surfaces;
using SlimDX.DXGI;

namespace JamesZhao.Engine.Graphics.RenderStages
{
    internal class PresentStage : RenderStage
    {
        public override string Name
        {
            get { return "Present"; }
        }

        public ColorSurface SourceSurface { get; set; }

        protected override void OnRender(GraphicsDevice device, SwapChain swapChain, VisualsList visualsList,
                                         Camera camera)
        {
            device.ImmediateContext.CopyResource(SourceSurface.Texture, FinalColorSurface.Texture);
            swapChain.Present(0, PresentFlags.None);
        }
    }
}